package cn.xtcode.domain.trade.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.checkerframework.checker.units.qual.N;

/**
 * @Author xt-code
 * @Description:
 * @Create 2025/5/9 18:38
 */
@Getter
@NoArgsConstructor
@AllArgsConstructor
public enum TradeOrderStatusEnumVO {
    CREATE(0, "初始创建"),
    COMPLETE(1, "消费完成"),
    CLOSE(2, "超时关单"),
    ;

    private Integer code;
    private String info;

    public static TradeOrderStatusEnumVO valueOf(Integer code) {
        switch (code) {
            case 0:
                return CREATE;
            case 1:
                return COMPLETE;
            case 2:
                return CLOSE;
        }
        //抛异常也可以
        return CREATE;
    }
}
